import cheerio from 'cheerio';
async function getUserData(user) {
  const response = await fetch(user, {
    method: "GET",
    mode: "cros",
    headers: {
      "Content-Type": "text/html"
    }
  });
  const $ = cheerio.load(await response.text());
  console.log('$: ', $.html());
  console.log('response: ',response);
  console.log('$:==============>>>>>>>>>>>>>>>>>>> ', $('#pageletReflowVideo').children('.video-container').children('.player-container').children('.upload-video'));

  /* return {
    avatar: 'http:' + $('.avatar img').attr('src'),
    name: $('.title .name').text(),
    articles: $('.note-list li').map(function () {
      return {
        title: $('.title', this).text(),
      }
    }).get()
  } */
}
export {
  getUserData
}
/* export function getUserData(user) {
  console.log('user: ', user);
  return new Promise((resolve, reject) => {
    const response = await fetch(user);
    const $ = cheerio.load(await response.text());
    console.log('$ : ', $);
  })
} */